fix(restore): ignore __MACOSX metadata when selecting binary artifacts - #40
Open
sanghyeok-kim wants to merge 1 commit into
Open
Conversation
Binary artifact discovery recognized an .xcframework by directory extension and returned the last match. For archives zipped on macOS, a sibling __MACOSX/<name>.xcframework metadata copy could be selected and written into workspace-state.json, making Tuist fail with a missing Info.plist. Skip __MACOSX entries during discovery so selection points at the real .xcframework. The restored archive contents, including __MACOSX, are left untouched on disk. Add a regression test for an archive that contains both a real .xcframework and a __MACOSX metadata copy.
sanghyeok-kim
requested review from
esnunes and
fortmarek
and removed request for
a team
June 16, 2026 06:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
__MACOSXmetadata filtering for restored binary artifacts with Tuist's handling.workspace-state.jsonpointed at the actual.xcframeworkby ignoring__MACOSXmetadata entries during artifact selection..xcframeworkand a__MACOSXmetadata copy.Context
Some vendor binary artifact archives include macOS zip metadata alongside the real framework:
__MACOSXis zip metadata generated by macOS tooling. The metadata copy can still have a.xcframeworkdirectory suffix, but it does not represent the framework that should be advertised to downstream tooling.Tuist already treats these directories as metadata when mapping remote XCFrameworks. The fallback glob filters out XCFrameworks whose parent directory is
__MACOSX:This change applies the same intent when swifterpm discovers restored binary artifacts for
workspace-state.json. For affected packages, the state file could otherwise point at a metadata path:The restored archive contents are left intact, including
__MACOSX. Only artifact selection skips metadata entries, so Tuist receives the real XCFramework path. This matches the scope of Tuist's own__MACOSXfilter.The regression test follows the same boundary. It verifies that selection excludes
__MACOSXentries even when a metadata entry has a plausible.xcframeworkshape, rather than validating each candidate byInfo.plist.Validating each
.xcframeworkby its rootInfo.plist(as SwiftPM'sXCFrameworkMetadatadoes) could harden discovery further, but is left out to keep the change scoped to this__MACOSXartifact selection case.Testing
swift build -c release --product swifterpmswift testReproduction
Then, with swifterpm enabled (
TUIST_USE_SWIFTERPM=1), runtuist installandtuist generate. Generation fails: